package com.zzptc.myapp8;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import java.lang.reflect.Array;
import java.util.List;

public class Main4Activity extends AppCompatActivity {
    String[] s={"第一行","第二行","第三行","第四行","第五行","第六行","第七行","第八行","第九行"};
    ListView lv2;
    ArrayAdapter<String> adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activit_mian4);
      lv2=findViewById(R.id.lv2);
       adapter=
              new ArrayAdapter<>(Main4Activity.this, android.R.layout.simple_list_item_1, s);
        lv2.setAdapter(adapter);


    }
}
